package test.y2020;

import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.Console;

import java.util.concurrent.*;

/**
 * Created By  醉美柳舞之众星捧月
 *
 * @author song
 * @date 2020/4/7 15:46
 */
public class April4 {

    private static final Executor EXECUTOR = new ThreadPoolExecutor(16,
            32, 1, TimeUnit.MILLISECONDS,
            new LinkedBlockingQueue<>(1024), (ThreadFactory) Thread::new);

    public static void main(String[] args) {
        for (int i = 0; i <= 10; i++) {
            int finalI = i;
            EXECUTOR.execute(() -> la(finalI));
        }
    }

    private static void la(int i) {
        Console.error(String.format("第%s次         时间戳：%s      ", i, System.currentTimeMillis()) + DateUtil.now());
    }
}
